package com.aliyun.messagemgt.util;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName: SpringContextUtils
 * @Description:
 * @Author: wugongzi
 * @Date: 2021/11/4 14:38
 * @Version: 1.0
 */
public class SpringContextUtils {

    public static HttpServletRequest getRequest(){
        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
        return request;
    }
}
